﻿@using GrainManage.Web.Resources
@model GrainManage.Entities.Contact.OutputSearch
@{
    if (Model.Contacts != null)
    {
    <table data-total="@Model.Total">
        <tr>
            <th>@ContactResx.ContactID</th>
            <th>@ContactResx.ContactName</th>
            <th>@ContactResx.Gender</th>
            <th>@ContactResx.BirthDate</th>
            <th>@ContactResx.Cellphone</th>
            <th>@ContactResx.Telephone</th>
            <th>@ContactResx.QQ</th>
            <th>@ContactResx.Email</th>
            <th>@ContactResx.Area</th>
            <th>@ContactResx.Address</th>
            <th>@ContactResx.Remarks</th>
        </tr>
        @foreach (var contact in Model.Contacts)
        {
            <tr>
                <td>@contact.ContactID</td>
                <td>@contact.ContactName</td>
                <td>@contact.Gender</td>
                @{
            string date = contact.BirthDate.HasValue ? contact.BirthDate.Value.ToString(GlobalResx.DateFormat) : string.Empty;
                }
                <td>@date</td>
                <td>@contact.Cellphone</td>
                <td>@contact.Telephone</td>
                <td>@contact.QQ</td>
                <td>@contact.Email</td>
                <td>@contact.Area</td>
                <td>@contact.Address</td>
                @*   <td>
                        <img width="70" height="90" src="@contact.PhotoUrl"/>
                    </td>*@
                <td>@contact.Remarks</td>
                <td><a href="/Contact/EditContact?contactID=@contact.ContactID">@GlobalResx.Edit</a></td>
                <td><a href="/Trade/NewTrade?contactID=@contact.ContactID">@TradeResx.Trade</a></td>
            </tr>
        }
    </table>
    }
    else
    {
    @Html.Partial(GrainManage.Web.Constant.RestStatusView, Model);
    }
}